home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / misc / o-z / x-windows / mesa-amiwin / src / vertex.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-30  |  29.1 KB  |  1,724 lines

  1. /* vertex.c */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25. $Id: vertex.c,v 1.6 1995/10/19 15:49:41 brianp Exp $
  26.  
  27. $Log: vertex.c,v $
  28.  * Revision 1.6  1995/10/19  15:49:41  brianp
  29.  * check for argument underflow in glNormal3d[v] functions
  30.  *
  31.  * Revision 1.5  1995/10/04  19:35:37  brianp
  32.  * fixed bugs and optimized glNormal calls
  33.  *
  34.  * Revision 1.4  1995/07/25  16:41:54  brianp
  35.  * made changes for using CC.VertexFunc pointer
  36.  *
  37.  * Revision 1.3  1995/05/22  21:02:41  brianp
  38.  * Release 1.2
  39.  *
  40.  * Revision 1.2  1995/03/04  19:29:44  brianp
  41.  * 1.1 beta revision
  42.  *
  43.  * Revision 1.1  1995/02/24  14:28:31  brianp
  44.  * Initial revision
  45.  *
  46.  */
  47.  
  48.  
  49. /*
  50.  * glVertex*, glNormal*, glIndex*, and glColor* functions.
  51.  */
  52.  
  53.  
  54.  
  55. #include "context.h"
  56. #include "draw.h"
  57. #include "list.h"
  58. #include "macros.h"
  59.  
  60.  
  61.  
  62. /*
  63.  * Vertex
  64.  */
  65.  
  66.  
  67. /*** 2 arguments ***/
  68.  
  69. void glVertex2d( GLdouble x, GLdouble y )
  70. {
  71.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
  72. }
  73.  
  74.  
  75. void glVertex2f( GLfloat x, GLfloat y )
  76. {
  77.    (*CC.VertexFunc)( x, y, 0.0F, 1.0F );
  78. }
  79.  
  80.  
  81. void glVertex2i( GLint x, GLint y )
  82. {
  83.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
  84. }
  85.  
  86.  
  87. void glVertex2s( GLshort x, GLshort y )
  88. {
  89.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
  90. }
  91.  
  92.  
  93. /*** 3 arguments ***/
  94.  
  95. void glVertex3d( GLdouble x, GLdouble y, GLdouble z )
  96. {
  97.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
  98. }
  99.  
  100.  
  101. void glVertex3f( GLfloat x, GLfloat y, GLfloat z )
  102. {
  103.    (*CC.VertexFunc)( x, y, z, 1.0F );
  104. }
  105.  
  106.  
  107. void glVertex3i( GLint x, GLint y, GLint z )
  108. {
  109.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
  110. }
  111.  
  112.  
  113. void glVertex3s( GLshort x, GLshort y, GLshort z )
  114. {
  115.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
  116. }
  117.  
  118.  
  119. /*** 4 arguments ***/
  120.  
  121. void glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
  122. {
  123.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
  124. }
  125.  
  126.  
  127. void glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
  128. {
  129.    (*CC.VertexFunc)( x, y, z, w );
  130. }
  131.  
  132.  
  133. void glVertex4i( GLint x, GLint y, GLint z, GLint w )
  134. {
  135.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
  136. }
  137.  
  138.  
  139. void glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w )
  140. {
  141.    (*CC.VertexFunc)( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
  142. }
  143.  
  144.  
  145. /*** 2 element vector ***/
  146.  
  147. void glVertex2dv( const GLdouble *v )
  148. {
  149.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
  150. }
  151.  
  152.  
  153. void glVertex2fv( const GLfloat *v )
  154. {
  155.    (*CC.VertexFunc)( v[0], v[1], 0.0F, 1.0F );
  156. }
  157.  
  158.  
  159. void glVertex2iv( const GLint *v )
  160. {
  161.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
  162. }
  163.  
  164.  
  165. void glVertex2sv( const GLshort *v )
  166. {
  167.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
  168. }
  169.  
  170.  
  171.  
  172. /*** 3 element vector ***/
  173.  
  174. void glVertex3dv( const GLdouble *v )
  175. {
  176.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F );
  177. }
  178.  
  179.  
  180. void glVertex3fv( const GLfloat *v )
  181. {
  182.    (*CC.VertexFunc)( v[0], v[1], v[2], 1.0F );
  183. }
  184.  
  185.  
  186. void glVertex3iv( const GLint *v )
  187. {
  188.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F );
  189. }
  190.  
  191.  
  192. void glVertex3sv( const GLshort *v )
  193. {
  194.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F );
  195. }
  196.  
  197.  
  198. /*** 4 element vector ***/
  199.  
  200. void glVertex4dv( const GLdouble *v )
  201. {
  202.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1],
  203.              (GLfloat) v[2], (GLfloat) v[3] );
  204. }
  205.  
  206.  
  207. void glVertex4fv( const GLfloat *v )
  208. {
  209.    (*CC.VertexFunc)( v[0], v[1], v[2], v[3] );
  210. }
  211.  
  212.  
  213. void glVertex4iv( const GLint *v )
  214. {
  215.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1],
  216.              (GLfloat) v[2], (GLfloat) v[3] );
  217. }
  218.  
  219.  
  220. void glVertex4sv( const GLshort *v )
  221. {
  222.    (*CC.VertexFunc)( (GLfloat) v[0], (GLfloat) v[1],
  223.              (GLfloat) v[2], (GLfloat) v[3] );
  224. }
  225.  
  226.  
  227.  
  228. /*
  229.  * Normal vectors
  230.  */
  231.  
  232.  
  233. /*** 3 arguments ***/
  234.  
  235. void glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz )
  236. {
  237.    if (CC.CompileFlag) {
  238.       GLfloat x, y, z;
  239.       x = BYTE_TO_FLOAT(nx);
  240.       y = BYTE_TO_FLOAT(ny);
  241.       z = BYTE_TO_FLOAT(nz);
  242.       gl_save_normal3f( x, y, z );
  243.    }
  244.    if (CC.ExecuteFlag) {
  245.       CC.Current.Normal[0] = BYTE_TO_FLOAT(nz);
  246.       CC.Current.Normal[1] = BYTE_TO_FLOAT(ny);
  247.       CC.Current.Normal[2] = BYTE_TO_FLOAT(nz);
  248.    }
  249. }
  250.  
  251.  
  252. void glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz )
  253. {
  254.    GLfloat fx, fy, fz;
  255.    if (ABS(nx)<0.00001)   fx = 0.0F;   else  fx = nx;
  256.    if (ABS(ny)<0.00001)   fy = 0.0F;   else  fy = ny;
  257.    if (ABS(nz)<0.00001)   fz = 0.0F;   else  fz = nz;
  258.    if (CC.CompileFlag) {
  259.       gl_save_normal3f( fx, fy, fz );
  260.    }
  261.    if (CC.ExecuteFlag) {
  262.       CC.Current.Normal[0] = fx;
  263.       CC.Current.Normal[1] = fy;
  264.       CC.Current.Normal[2] = fz;
  265.    }
  266. }
  267.  
  268.  
  269. void glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz )
  270. {
  271.    if (CC.CompileFlag) {
  272.       gl_save_normal3f( nx, ny, nz );
  273.    }
  274.    if (CC.ExecuteFlag) {
  275.       CC.Current.Normal[0] = nx;
  276.       CC.Current.Normal[1] = ny;
  277.       CC.Current.Normal[2] = nz;
  278.    }
  279. }
  280.  
  281.  
  282. void glNormal3i( GLint nx, GLint ny, GLint nz )
  283. {
  284.    if (CC.CompileFlag) {
  285.       GLfloat x, y, z;
  286.       x = INT_TO_FLOAT(nx);
  287.       y = INT_TO_FLOAT(ny);
  288.       z = INT_TO_FLOAT(nz);
  289.       gl_save_normal3f( x, y, z );
  290.    }
  291.    if (CC.ExecuteFlag) {
  292.       CC.Current.Normal[0] = INT_TO_FLOAT(nx);
  293.       CC.Current.Normal[1] = INT_TO_FLOAT(ny);
  294.       CC.Current.Normal[2] = INT_TO_FLOAT(nz);
  295.    }
  296. }
  297.  
  298.  
  299. void glNormal3s( GLshort nx, GLshort ny, GLshort nz )
  300. {
  301.    if (CC.CompileFlag) {
  302.       GLfloat x, y, z;
  303.       x = SHORT_TO_FLOAT(nx);
  304.       y = SHORT_TO_FLOAT(ny);
  305.       z = SHORT_TO_FLOAT(nz);
  306.       gl_save_normal3f( x, y, z );
  307.    }
  308.    if (CC.ExecuteFlag) {
  309.       CC.Current.Normal[0] = SHORT_TO_FLOAT(nx);
  310.       CC.Current.Normal[1] = SHORT_TO_FLOAT(ny);
  311.       CC.Current.Normal[2] = SHORT_TO_FLOAT(nz);
  312.    }
  313. }
  314.  
  315.  
  316. /*** vector argument ***/
  317.  
  318. void glNormal3bv( const GLbyte *v )
  319. {
  320.    if (CC.CompileFlag) {
  321.       GLfloat x, y, z;
  322.       x = BYTE_TO_FLOAT(v[0]);
  323.       y = BYTE_TO_FLOAT(v[1]);
  324.       z = BYTE_TO_FLOAT(v[2]);
  325.       gl_save_normal3f( x, y, z );
  326.    }
  327.    if (CC.ExecuteFlag) {
  328.       CC.Current.Normal[0] = BYTE_TO_FLOAT(v[0]);
  329.       CC.Current.Normal[1] = BYTE_TO_FLOAT(v[1]);
  330.       CC.Current.Normal[2] = BYTE_TO_FLOAT(v[2]);
  331.    }
  332. }
  333.  
  334.  
  335. void glNormal3dv( const GLdouble *v )
  336. {
  337.    GLfloat fx, fy, fz;
  338.    if (ABS(v[0])<0.00001)   fx = 0.0F;   else  fx = v[0];
  339.    if (ABS(v[1])<0.00001)   fy = 0.0F;   else  fy = v[1];
  340.    if (ABS(v[2])<0.00001)   fz = 0.0F;   else  fz = v[2];
  341.    if (CC.CompileFlag) {
  342.       gl_save_normal3f( fx, fy, fz );
  343.    }
  344.    if (CC.ExecuteFlag) {
  345.       CC.Current.Normal[0] = fx;
  346.       CC.Current.Normal[1] = fy;
  347.       CC.Current.Normal[2] = fz;
  348.    }
  349. }
  350.  
  351.  
  352. void glNormal3fv( const GLfloat *v )
  353. {
  354.    if (CC.CompileFlag) {
  355.       gl_save_normal3fv( v );
  356.    }
  357.    if (CC.ExecuteFlag) {
  358.       CC.Current.Normal[0] = v[0];
  359.       CC.Current.Normal[1] = v[1];
  360.       CC.Current.Normal[2] = v[2];
  361.    }
  362. }
  363.  
  364.  
  365. void glNormal3iv( const GLint *v )
  366. {
  367.    if (CC.CompileFlag) {
  368.       GLfloat x, y, z;
  369.       x = INT_TO_FLOAT(v[0]);
  370.       y = INT_TO_FLOAT(v[1]);
  371.       z = INT_TO_FLOAT(v[2]);
  372.       gl_save_normal3f( x, y, z );
  373.    }
  374.    if (CC.ExecuteFlag) {
  375.       CC.Current.Normal[0] = INT_TO_FLOAT(v[0]);
  376.       CC.Current.Normal[1] = INT_TO_FLOAT(v[1]);
  377.       CC.Current.Normal[2] = INT_TO_FLOAT(v[2]);
  378.    }
  379. }
  380.  
  381.  
  382. void glNormal3sv( const GLshort *v )
  383. {
  384.    if (CC.CompileFlag) {
  385.       GLfloat x, y, z;
  386.       x = SHORT_TO_FLOAT(v[0]);
  387.       y = SHORT_TO_FLOAT(v[1]);
  388.       z = SHORT_TO_FLOAT(v[2]);
  389.       gl_save_normal3f( x, y, z );
  390.    }
  391.    if (CC.ExecuteFlag) {
  392.       CC.Current.Normal[0] = SHORT_TO_FLOAT(v[0]);
  393.       CC.Current.Normal[1] = SHORT_TO_FLOAT(v[1]);
  394.       CC.Current.Normal[2] = SHORT_TO_FLOAT(v[2]);
  395.    }
  396. }
  397.  
  398.  
  399.  
  400. /*
  401.  * Color Index
  402.  */
  403.  
  404.  
  405. void glIndexd( GLdouble c )
  406. {
  407.    if (CC.CompileFlag) {
  408.       gl_save_index( (GLuint) c );
  409.    }
  410.    if (CC.ExecuteFlag) {
  411.       gl_index( (GLuint) c );
  412.    }
  413. }
  414.  
  415.  
  416. void glIndexf( GLfloat c )
  417. {
  418.    if (CC.CompileFlag) {
  419.       gl_save_index( (GLuint) c );
  420.    }
  421.    if (CC.ExecuteFlag) {
  422.       gl_index( (GLuint) c );
  423.    }
  424. }
  425.  
  426.  
  427. void glIndexi( GLint c )
  428. {
  429.    if (CC.CompileFlag) {
  430.       gl_save_index( (GLuint) c );
  431.    }
  432.    if (CC.ExecuteFlag) {
  433.       gl_index( (GLuint) c );
  434.    }
  435. }
  436.  
  437.  
  438. void glIndexs( GLshort c )
  439. {
  440.    if (CC.CompileFlag) {
  441.       gl_save_index( (GLuint) c );
  442.    }
  443.    if (CC.ExecuteFlag) {
  444.       gl_index( (GLuint) c );
  445.    }
  446. }
  447.  
  448.  
  449. void glIndexdv( const GLdouble *c )
  450. {
  451.    if (CC.CompileFlag) {
  452.       gl_save_index( (GLuint) *c );
  453.    }
  454.    if (CC.ExecuteFlag) {
  455.       gl_index( (GLuint) *c );
  456.    }
  457. }
  458.  
  459.  
  460. void glIndexfv( const GLfloat *c )
  461. {
  462.    if (CC.CompileFlag) {
  463.       gl_save_index( (GLuint) *c );
  464.    }
  465.    if (CC.ExecuteFlag) {
  466.       gl_index( (GLuint) *c );
  467.    }
  468. }
  469.  
  470.  
  471. void glIndexiv( const GLint *c )
  472. {
  473.    if (CC.CompileFlag) {
  474.       gl_save_index( (GLuint) *c );
  475.    }
  476.    if (CC.ExecuteFlag) {
  477.       gl_index( (GLuint) *c );
  478.    }
  479. }
  480.  
  481.  
  482. void glIndexsv( const GLshort *c )
  483. {
  484.    if (CC.CompileFlag) {
  485.       gl_save_index( (GLuint) *c );
  486.    }
  487.    if (CC.ExecuteFlag) {
  488.       gl_index( (GLuint) *c );
  489.    }
  490. }
  491.  
  492.  
  493.  
  494. /*
  495.  * Color
  496.  */
  497.  
  498.  
  499. void glColor3b( GLbyte red, GLbyte green, GLbyte blue )
  500. {
  501.    GLfloat c[4];
  502.  
  503.    c[0] = BYTE_TO_FLOAT(red);
  504.    c[1] = BYTE_TO_FLOAT(green);
  505.    c[2] = BYTE_TO_FLOAT(blue);
  506.    c[3] = 1.0;
  507.  
  508.    if (CC.CompileFlag) {
  509.       gl_save_color( c );
  510.    }
  511.    if (CC.ExecuteFlag) {
  512.       gl_color( c );
  513.    }
  514. }
  515.  
  516.  
  517. void glColor3d( GLdouble red, GLdouble green, GLdouble blue )
  518. {
  519.    GLfloat c[4];
  520.  
  521.    c[0] = (GLfloat) red;
  522.    c[1] = (GLfloat) green;
  523.    c[2] = (GLfloat) blue;
  524.    c[3] = 1.0;
  525.  
  526.    if (CC.CompileFlag) {
  527.       gl_save_color( c );
  528.    }
  529.    if (CC.ExecuteFlag) {
  530.       gl_color( c );
  531.    }
  532. }
  533.  
  534.  
  535. void glColor3f( GLfloat red, GLfloat green, GLfloat blue )
  536. {
  537.    GLfloat c[4];
  538.  
  539.    c[0] = red;
  540.    c[1] = green;
  541.    c[2] = blue;
  542.    c[3] = 1.0;
  543.  
  544.    if (CC.CompileFlag) {
  545.       gl_save_color( c );
  546.    }
  547.    if (CC.ExecuteFlag) {
  548.       gl_color( c );
  549.    }
  550. }
  551.  
  552.  
  553. void glColor3i( GLint red, GLint green, GLint blue )
  554. {
  555.    GLfloat c[4];
  556.  
  557.    c[0] = INT_TO_FLOAT(red);
  558.    c[1] = INT_TO_FLOAT(green);
  559.    c[2] = INT_TO_FLOAT(blue);
  560.    c[3] = 1.0;
  561.  
  562.    if (CC.CompileFlag) {
  563.       gl_save_color( c );
  564.    }
  565.    if (CC.ExecuteFlag) {
  566.       gl_color( c );
  567.    }
  568. }
  569.  
  570.  
  571. void glColor3s( GLshort red, GLshort green, GLshort blue )
  572. {
  573.    GLfloat c[4];
  574.  
  575.    c[0] = SHORT_TO_FLOAT(red);
  576.    c[1] = SHORT_TO_FLOAT(green);
  577.    c[2] = SHORT_TO_FLOAT(blue);
  578.    c[3] = 1.0;
  579.  
  580.    if (CC.CompileFlag) {
  581.       gl_save_color( c );
  582.    }
  583.    if (CC.ExecuteFlag) {
  584.       gl_color( c );
  585.    }
  586. }
  587.  
  588.  
  589. void glColor3ub( GLubyte red, GLubyte green, GLubyte blue )
  590. {
  591.    GLfloat c[4];
  592.  
  593.    c[0] = UBYTE_TO_FLOAT(red);
  594.    c[1] = UBYTE_TO_FLOAT(green);
  595.    c[2] = UBYTE_TO_FLOAT(blue);
  596.    c[3] = 1.0;
  597.  
  598.    if (CC.CompileFlag) {
  599.       gl_save_color( c );
  600.    }
  601.    if (CC.ExecuteFlag) {
  602.       gl_color( c );
  603.    }
  604. }
  605.  
  606.  
  607. void glColor3ui( GLuint red, GLuint green, GLuint blue )
  608. {
  609.    GLfloat c[4];
  610.  
  611.    c[0] = UINT_TO_FLOAT(red);
  612.    c[1] = UINT_TO_FLOAT(green);
  613.    c[2] = UINT_TO_FLOAT(blue);
  614.    c[3] = 1.0;
  615.  
  616.    if (CC.CompileFlag) {
  617.       gl_save_color( c );
  618.    }
  619.    if (CC.ExecuteFlag) {
  620.       gl_color( c );
  621.    }
  622. }
  623.  
  624.  
  625. void glColor3us( GLushort red, GLushort green, GLushort blue )
  626. {
  627.    GLfloat c[4];
  628.  
  629.    c[0] = USHORT_TO_FLOAT(red);
  630.    c[1] = USHORT_TO_FLOAT(green);
  631.    c[2] = USHORT_TO_FLOAT(blue);
  632.    c[3] = 1.0;
  633.  
  634.    if (CC.CompileFlag) {
  635.       gl_save_color( c );
  636.    }
  637.    if (CC.ExecuteFlag) {
  638.       gl_color( c );
  639.    }
  640. }
  641.  
  642.  
  643. void glColor4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha )
  644. {
  645.    GLfloat c[4];
  646.  
  647.    c[0] = BYTE_TO_FLOAT(red);
  648.    c[1] = BYTE_TO_FLOAT(green);
  649.    c[2] = BYTE_TO_FLOAT(blue);
  650.    c[3] = BYTE_TO_FLOAT(alpha);
  651.  
  652.    if (CC.CompileFlag) {
  653.       gl_save_color( c );
  654.    }
  655.    if (CC.ExecuteFlag) {
  656.       gl_color( c );
  657.    }
  658. }
  659.  
  660.  
  661. void glColor4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha )
  662. {
  663.    GLfloat c[4];
  664.  
  665.    c[0] = (GLfloat) red;
  666.    c[1] = (GLfloat) green;
  667.    c[2] = (GLfloat) blue;
  668.    c[3] = (GLfloat) alpha;
  669.  
  670.    if (CC.CompileFlag) {
  671.       gl_save_color( c );
  672.    }
  673.    if (CC.ExecuteFlag) {
  674.       gl_color( c );
  675.    }
  676. }
  677.  
  678.  
  679. void glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
  680. {
  681.    GLfloat v[4];
  682.  
  683.    v[0] = red;
  684.    v[1] = green;
  685.    v[2] = blue;
  686.    v[3] = alpha;
  687.  
  688.    if (CC.CompileFlag) {
  689.       gl_save_color( v );
  690.    }
  691.    if (CC.ExecuteFlag) {
  692.       gl_color( v );
  693.    }
  694. }
  695.  
  696.  
  697. void glColor4i( GLint red, GLint green, GLint blue, GLint alpha )
  698. {
  699.    GLfloat c[4];
  700.  
  701.    c[0] = INT_TO_FLOAT(red);
  702.    c[1] = INT_TO_FLOAT(green);
  703.    c[2] = INT_TO_FLOAT(blue);
  704.    c[3] = INT_TO_FLOAT(alpha);
  705.  
  706.    if (CC.CompileFlag) {
  707.       gl_save_color( c );
  708.    }
  709.    if (CC.ExecuteFlag) {
  710.       gl_color( c );
  711.    }
  712. }
  713.  
  714.  
  715. void glColor4s( GLshort red, GLshort green, GLshort blue, GLshort alpha )
  716. {
  717.    GLfloat c[4];
  718.  
  719.    c[0] = SHORT_TO_FLOAT(red);
  720.    c[1] = SHORT_TO_FLOAT(green);
  721.    c[2] = SHORT_TO_FLOAT(blue);
  722.    c[3] = SHORT_TO_FLOAT(alpha);
  723.  
  724.    if (CC.CompileFlag) {
  725.       gl_save_color( c );
  726.    }
  727.    if (CC.ExecuteFlag) {
  728.       gl_color( c );
  729.    }
  730. }
  731.  
  732.  
  733. void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
  734. {
  735.    GLfloat c[4];
  736.  
  737.    c[0] = UBYTE_TO_FLOAT(red);
  738.    c[1] = UBYTE_TO_FLOAT(green);
  739.    c[2] = UBYTE_TO_FLOAT(blue);
  740.    c[3] = UBYTE_TO_FLOAT(alpha);
  741.  
  742.    if (CC.CompileFlag) {
  743.       gl_save_color( c );
  744.    }
  745.    if (CC.ExecuteFlag) {
  746.       gl_color( c );
  747.    }
  748. }
  749.  
  750.  
  751. void glColor4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha )
  752. {
  753.    GLfloat c[4];
  754.  
  755.    c[0] = UINT_TO_FLOAT(red);
  756.    c[1] = UINT_TO_FLOAT(green);
  757.    c[2] = UINT_TO_FLOAT(blue);
  758.    c[3] = UINT_TO_FLOAT(alpha);
  759.  
  760.    if (CC.CompileFlag) {
  761.       gl_save_color( c );
  762.    }
  763.    if (CC.ExecuteFlag) {
  764.       gl_color( c );
  765.    }
  766. }
  767.  
  768.  
  769. void glColor4us( GLushort red, GLushort green, GLushort blue, GLushort alpha )
  770. {
  771.    GLfloat c[4];
  772.  
  773.    c[0] = USHORT_TO_FLOAT(red);
  774.    c[1] = USHORT_TO_FLOAT(green);
  775.    c[2] = USHORT_TO_FLOAT(blue);
  776.    c[3] = USHORT_TO_FLOAT(alpha);
  777.  
  778.    if (CC.CompileFlag) {
  779.       gl_save_color( c );
  780.    }
  781.    if (CC.ExecuteFlag) {
  782.       gl_color( c );
  783.    }
  784. }
  785.  
  786.  
  787. void glColor3bv( const GLbyte *v )
  788. {
  789.    GLfloat c[4];
  790.  
  791.    c[0] = BYTE_TO_FLOAT(v[0]);
  792.    c[1] = BYTE_TO_FLOAT(v[1]);
  793.    c[2] = BYTE_TO_FLOAT(v[2]);
  794.    c[3] = 1.0;
  795.  
  796.    if (CC.CompileFlag) {
  797.       gl_save_color( c );
  798.    }
  799.    if (CC.ExecuteFlag) {
  800.       gl_color( c );
  801.    }
  802. }
  803.  
  804.  
  805. void glColor3dv( const GLdouble *v )
  806. {
  807.    GLfloat c[4];
  808.  
  809.    c[0] = (GLfloat) v[0];
  810.    c[1] = (GLfloat) v[1];
  811.    c[2] = (GLfloat) v[2];
  812.    c[3] = 1.0;
  813.  
  814.    if (CC.CompileFlag) {
  815.       gl_save_color( c );
  816.    }
  817.    if (CC.ExecuteFlag) {
  818.       gl_color( c );
  819.    }
  820. }
  821.  
  822.  
  823. void glColor3fv( const GLfloat *v )
  824. {
  825.    GLfloat c[4];
  826.  
  827.    c[0] = v[0];
  828.    c[1] = v[1];
  829.    c[2] = v[2];
  830.    c[3] = 1.0;
  831.  
  832.    if (CC.CompileFlag) {
  833.       gl_save_color( c );
  834.    }
  835.    if (CC.ExecuteFlag) {
  836.       gl_color( c );
  837.    }
  838. }
  839.  
  840.  
  841. void glColor3iv( const GLint *v )
  842. {
  843.    GLfloat c[4];
  844.  
  845.    c[0] = INT_TO_FLOAT(v[0]);
  846.    c[1] = INT_TO_FLOAT(v[1]);
  847.    c[2] = INT_TO_FLOAT(v[2]);
  848.    c[3] = 1.0;
  849.  
  850.    if (CC.CompileFlag) {
  851.       gl_save_color( c );
  852.    }
  853.    if (CC.ExecuteFlag) {
  854.       gl_color( c );
  855.    }
  856. }
  857.  
  858.  
  859. void glColor3sv( const GLshort *v )
  860. {
  861.    GLfloat c[4];
  862.  
  863.    c[0] = SHORT_TO_FLOAT(v[0]);
  864.    c[1] = SHORT_TO_FLOAT(v[1]);
  865.    c[2] = SHORT_TO_FLOAT(v[2]);
  866.    c[3] = 1.0;
  867.  
  868.    if (CC.CompileFlag) {
  869.       gl_save_color( c );
  870.    }
  871.    if (CC.ExecuteFlag) {
  872.       gl_color( c );
  873.    }
  874. }
  875.  
  876.  
  877. void glColor3ubv( const GLubyte *v )
  878. {
  879.    GLfloat c[4];
  880.  
  881.    c[0] = UBYTE_TO_FLOAT(v[0]);
  882.    c[1] = UBYTE_TO_FLOAT(v[1]);
  883.    c[2] = UBYTE_TO_FLOAT(v[2]);
  884.    c[3] = 1.0;
  885.  
  886.    if (CC.CompileFlag) {
  887.       gl_save_color( c );
  888.    }
  889.    if (CC.ExecuteFlag) {
  890.       gl_color( c );
  891.    }
  892. }
  893.  
  894.  
  895. void glColor3uiv( const GLuint *v )
  896. {
  897.    GLfloat c[4];
  898.  
  899.    c[0] = UINT_TO_FLOAT(v[0]);
  900.    c[1] = UINT_TO_FLOAT(v[1]);
  901.    c[2] = UINT_TO_FLOAT(v[2]);
  902.    c[3] = 1.0;
  903.  
  904.    if (CC.CompileFlag) {
  905.       gl_save_color( c );
  906.    }
  907.    if (CC.ExecuteFlag) {
  908.       gl_color( c );
  909.    }
  910. }
  911.  
  912.  
  913. void glColor3usv( const GLushort *v )
  914. {
  915.    GLfloat c[4];
  916.  
  917.    c[0] = USHORT_TO_FLOAT(v[0]);
  918.    c[1] = USHORT_TO_FLOAT(v[1]);
  919.    c[2] = USHORT_TO_FLOAT(v[2]);
  920.    c[3] = 1.0;
  921.  
  922.    if (CC.CompileFlag) {
  923.       gl_save_color( c );
  924.    }
  925.    if (CC.ExecuteFlag) {
  926.       gl_color( c );
  927.    }
  928. }
  929.  
  930.  
  931. void glColor4bv( const GLbyte *v )
  932. {
  933.    GLfloat c[4];
  934.  
  935.    c[0] = BYTE_TO_FLOAT(v[0]);
  936.    c[1] = BYTE_TO_FLOAT(v[1]);
  937.    c[2] = BYTE_TO_FLOAT(v[2]);
  938.    c[3] = BYTE_TO_FLOAT(v[3]);
  939.  
  940.    if (CC.CompileFlag) {
  941.       gl_save_color( c );
  942.    }
  943.    if (CC.ExecuteFlag) {
  944.       gl_color( c );
  945.    }
  946. }
  947.  
  948.  
  949. void glColor4dv( const GLdouble *v )
  950. {
  951.    GLfloat c[4];
  952.  
  953.    c[0] = (GLfloat) v[0];
  954.    c[1] = (GLfloat) v[1];
  955.    c[2] = (GLfloat) v[2];
  956.    c[3] = (GLfloat) v[3];
  957.  
  958.    if (CC.CompileFlag) {
  959.       gl_save_color( c );
  960.    }
  961.    if (CC.ExecuteFlag) {
  962.       gl_color( c );
  963.    }
  964. }
  965.  
  966.  
  967. void glColor4fv( const GLfloat *v )
  968. {
  969.    if (CC.CompileFlag) {
  970.       gl_save_color( v );
  971.    }
  972.    if (CC.ExecuteFlag) {
  973.       gl_color( v );
  974.    }
  975. }
  976.  
  977.  
  978. void glColor4iv( const GLint *v )
  979. {
  980.    GLfloat c[4];
  981.  
  982.    c[0] = INT_TO_FLOAT(v[0]);
  983.    c[1] = INT_TO_FLOAT(v[1]);
  984.    c[2] = INT_TO_FLOAT(v[2]);
  985.    c[3] = INT_TO_FLOAT(v[3]);
  986.  
  987.    if (CC.CompileFlag) {
  988.       gl_save_color( c );
  989.    }
  990.    if (CC.ExecuteFlag) {
  991.       gl_color( c );
  992.    }
  993. }
  994.  
  995.  
  996. void glColor4sv( const GLshort *v )
  997. {
  998.    GLfloat c[4];
  999.  
  1000.    c[0] = SHORT_TO_FLOAT(v[0]);
  1001.    c[1] = SHORT_TO_FLOAT(v[1]);
  1002.    c[2] = SHORT_TO_FLOAT(v[2]);
  1003.    c[3] = SHORT_TO_FLOAT(v[3]);
  1004.  
  1005.    if (CC.CompileFlag) {
  1006.       gl_save_color( c );
  1007.    }
  1008.    if (CC.ExecuteFlag) {
  1009.       gl_color( c );
  1010.    }
  1011. }
  1012.  
  1013.  
  1014. void glColor4ubv( const GLubyte *v )
  1015. {
  1016.    GLfloat c[4];
  1017.  
  1018.    c[0] = UBYTE_TO_FLOAT(v[0]);
  1019.    c[1] = UBYTE_TO_FLOAT(v[1]);
  1020.    c[2] = UBYTE_TO_FLOAT(v[2]);
  1021.    c[3] = UBYTE_TO_FLOAT(v[3]);
  1022.  
  1023.    if (CC.CompileFlag) {
  1024.       gl_save_color( c );
  1025.    }
  1026.    if (CC.ExecuteFlag) {
  1027.       gl_color( c );
  1028.    }
  1029. }
  1030.  
  1031.  
  1032. void glColor4uiv( const GLuint *v )
  1033. {
  1034.    GLfloat c[4];
  1035.  
  1036.    c[0] = UINT_TO_FLOAT(v[0]);
  1037.    c[1] = UINT_TO_FLOAT(v[1]);
  1038.    c[2] = UINT_TO_FLOAT(v[2]);
  1039.    c[3] = UINT_TO_FLOAT(v[3]);
  1040.  
  1041.    if (CC.CompileFlag) {
  1042.       gl_save_color( c );
  1043.    }
  1044.    if (CC.ExecuteFlag) {
  1045.       gl_color( c );
  1046.    }
  1047. }
  1048.  
  1049.  
  1050. void glColor4usv( const GLushort *v )
  1051. {
  1052.    GLfloat c[4];
  1053.  
  1054.    c[0] = USHORT_TO_FLOAT(v[0]);
  1055.    c[1] = USHORT_TO_FLOAT(v[1]);
  1056.    c[2] = USHORT_TO_FLOAT(v[2]);
  1057.    c[3] = USHORT_TO_FLOAT(v[3]);
  1058.  
  1059.    if (CC.CompileFlag) {
  1060.       gl_save_color( c );
  1061.    }
  1062.    if (CC.ExecuteFlag) {
  1063.       gl_color( c );
  1064.    }
  1065. }
  1066.  
  1067.  
  1068.  
  1069. /*
  1070.  * glRasterPos* functions
  1071.  */
  1072.  
  1073.  
  1074. void glRasterPos2d( GLdouble x, GLdouble y )
  1075. {
  1076.    GLfloat v[4];
  1077.  
  1078.    v[0] = (GLfloat) x;
  1079.    v[1] = (GLfloat) y;
  1080.    v[2] = 0.0;
  1081.    v[3] = 1.0;
  1082.  
  1083.    if (CC.CompileFlag) {
  1084.       gl_save_rasterpos( v );
  1085.    }
  1086.    if (CC.ExecuteFlag) {
  1087.       gl_rasterpos( v );
  1088.    }
  1089. }
  1090.  
  1091.  
  1092. void glRasterPos2f( GLfloat x, GLfloat y )
  1093. {
  1094.    GLfloat v[4];
  1095.  
  1096.    v[0] = x;
  1097.    v[1] = y;
  1098.    v[2] = 0.0;
  1099.    v[3] = 1.0;
  1100.  
  1101.    if (CC.CompileFlag) {
  1102.       gl_save_rasterpos( v );
  1103.    }
  1104.    if (CC.ExecuteFlag) {
  1105.       gl_rasterpos( v );
  1106.    }
  1107. }
  1108.  
  1109.  
  1110. void glRasterPos2i( GLint x, GLint y )
  1111. {
  1112.    GLfloat v[4];
  1113.  
  1114.    v[0] = (GLfloat) x;
  1115.    v[1] = (GLfloat) y;
  1116.    v[2] = 0.0;
  1117.    v[3] = 1.0;
  1118.  
  1119.    if (CC.CompileFlag) {
  1120.       gl_save_rasterpos( v );
  1121.    }
  1122.    if (CC.ExecuteFlag) {
  1123.       gl_rasterpos( v );
  1124.    }
  1125. }
  1126.  
  1127.  
  1128. void glRasterPos2s( GLshort x, GLshort y )
  1129. {
  1130.    GLfloat v[4];
  1131.  
  1132.    v[0] = (GLfloat) x;
  1133.    v[1] = (GLfloat) y;
  1134.    v[2] = 0.0;
  1135.    v[3] = 1.0;
  1136.  
  1137.    if (CC.CompileFlag) {
  1138.       gl_save_rasterpos( v );
  1139.    }
  1140.    if (CC.ExecuteFlag) {
  1141.       gl_rasterpos( v );
  1142.    }
  1143. }
  1144.  
  1145.  
  1146. /*** 3 arguments ***/
  1147.  
  1148. void glRasterPos3d( GLdouble x, GLdouble y, GLdouble z )
  1149. {
  1150.    GLfloat v[4];
  1151.  
  1152.    v[0] = (GLfloat) x;
  1153.    v[1] = (GLfloat) y;
  1154.    v[2] = (GLfloat) z;
  1155.    v[3] = 1.0;
  1156.  
  1157.    if (CC.CompileFlag) {
  1158.       gl_save_rasterpos( v );
  1159.    }
  1160.    if (CC.ExecuteFlag) {
  1161.       gl_rasterpos( v );
  1162.    }
  1163. }
  1164.  
  1165.  
  1166. void glRasterPos3f( GLfloat x, GLfloat y, GLfloat z )
  1167. {
  1168.    GLfloat v[4];
  1169.  
  1170.    v[0] = x;
  1171.    v[1] = y;
  1172.    v[2] = z;
  1173.    v[3] = 1.0;
  1174.  
  1175.    if (CC.CompileFlag) {
  1176.       gl_save_rasterpos( v );
  1177.    }
  1178.    if (CC.ExecuteFlag) {
  1179.       gl_rasterpos( v );
  1180.    }
  1181. }
  1182.  
  1183.  
  1184. void glRasterPos3i( GLint x, GLint y, GLint z )
  1185. {
  1186.    GLfloat v[4];
  1187.  
  1188.    v[0] = (GLfloat) x;
  1189.    v[1] = (GLfloat) y;
  1190.    v[2] = (GLfloat) z;
  1191.    v[3] = 1.0;
  1192.  
  1193.    if (CC.CompileFlag) {
  1194.       gl_save_rasterpos( v );
  1195.    }
  1196.    if (CC.ExecuteFlag) {
  1197.       gl_rasterpos( v );
  1198.    }
  1199. }
  1200.  
  1201.  
  1202. void glRasterPos3s( GLshort x, GLshort y, GLshort z )
  1203. {
  1204.    GLfloat v[4];
  1205.  
  1206.    v[0] = (GLfloat) x;
  1207.    v[1] = (GLfloat) y;
  1208.    v[2] = (GLfloat) z;
  1209.    v[3] = 1.0;
  1210.  
  1211.    if (CC.CompileFlag) {
  1212.       gl_save_rasterpos( v );
  1213.    }
  1214.    if (CC.ExecuteFlag) {
  1215.       gl_rasterpos( v );
  1216.    }
  1217. }
  1218.  
  1219.  
  1220. /*** 4 arguments ***/
  1221.  
  1222. void glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
  1223. {
  1224.    GLfloat v[4];
  1225.  
  1226.    v[0] = (GLfloat) x;
  1227.    v[1] = (GLfloat) y;
  1228.    v[2] = (GLfloat) z;
  1229.    v[3] = (GLfloat) w;
  1230.  
  1231.    if (CC.CompileFlag) {
  1232.       gl_save_rasterpos( v );
  1233.    }
  1234.    if (CC.ExecuteFlag) {
  1235.       gl_rasterpos( v );
  1236.    }
  1237. }
  1238.  
  1239.  
  1240. void glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
  1241. {
  1242.    GLfloat v[4];
  1243.  
  1244.    /* maybe:  GLfloat *v = &x ??? */
  1245.    v[0] = x;
  1246.    v[1] = y;
  1247.    v[2] = z;
  1248.    v[3] = w;
  1249.  
  1250.    if (CC.CompileFlag) {
  1251.       gl_save_rasterpos( v );
  1252.    }
  1253.    if (CC.ExecuteFlag) {
  1254.       gl_rasterpos( v );
  1255.    }
  1256. }
  1257.  
  1258.  
  1259. void glRasterPos4i( GLint x, GLint y, GLint z, GLint w )
  1260. {
  1261.    GLfloat v[4];
  1262.  
  1263.    v[0] = (GLfloat) x;
  1264.    v[1] = (GLfloat) y;
  1265.    v[2] = (GLfloat) z;
  1266.    v[3] = (GLfloat) w;
  1267.  
  1268.    if (CC.CompileFlag) {
  1269.       gl_save_rasterpos( v );
  1270.    }
  1271.    if (CC.ExecuteFlag) {
  1272.       gl_rasterpos( v );
  1273.    }
  1274. }
  1275.  
  1276.  
  1277. void glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w )
  1278. {
  1279.    GLfloat v[4];
  1280.  
  1281.    v[0] = (GLfloat) x;
  1282.    v[1] = (GLfloat) y;
  1283.    v[2] = (GLfloat) z;
  1284.    v[3] = (GLfloat) w;
  1285.  
  1286.    if (CC.CompileFlag) {
  1287.       gl_save_rasterpos( v );
  1288.    }
  1289.    if (CC.ExecuteFlag) {
  1290.       gl_rasterpos( v );
  1291.    }
  1292. }
  1293.  
  1294.  
  1295. /*** 2 element vector ***/
  1296.  
  1297. void glRasterPos2dv( const GLdouble *v )
  1298. {
  1299.    GLfloat vv[4];
  1300.  
  1301.    vv[0] = (GLfloat) v[0];
  1302.    vv[1] = (GLfloat) v[1];
  1303.    vv[2] = 0.0;
  1304.    vv[3] = 1.0;
  1305.  
  1306.    if (CC.CompileFlag) {
  1307.       gl_save_rasterpos( vv );
  1308.    }
  1309.    if (CC.ExecuteFlag) {
  1310.       gl_rasterpos( vv );
  1311.    }
  1312. }
  1313.  
  1314.  
  1315. void glRasterPos2fv( const GLfloat *v )
  1316. {
  1317.    GLfloat vv[4];
  1318.  
  1319.    vv[0] = v[0];
  1320.    vv[1] = v[1];
  1321.    vv[2] = 0.0;
  1322.    vv[3] = 1.0;
  1323.  
  1324.    if (CC.CompileFlag) {
  1325.       gl_save_rasterpos( vv );
  1326.    }
  1327.    if (CC.ExecuteFlag) {
  1328.       gl_rasterpos( vv );
  1329.    }
  1330. }
  1331.  
  1332.  
  1333. void glRasterPos2iv( const GLint *v )
  1334. {
  1335.    GLfloat vv[4];
  1336.  
  1337.    vv[0] = (GLfloat) v[0];
  1338.    vv[1] = (GLfloat) v[1];
  1339.    vv[2] = 0.0;
  1340.    vv[3] = 1.0;
  1341.  
  1342.    if (CC.CompileFlag) {
  1343.       gl_save_rasterpos( vv );
  1344.    }
  1345.    if (CC.ExecuteFlag) {
  1346.       gl_rasterpos( vv );
  1347.    }
  1348. }
  1349.  
  1350.  
  1351. void glRasterPos2sv( const GLshort *v )
  1352. {
  1353.    GLfloat vv[4];
  1354.  
  1355.    vv[0] = (GLfloat) v[0];
  1356.    vv[1] = (GLfloat) v[1];
  1357.    vv[2] = 0.0;
  1358.    vv[3] = 1.0;
  1359.  
  1360.    if (CC.CompileFlag) {
  1361.       gl_save_rasterpos( vv );
  1362.    }
  1363.    if (CC.ExecuteFlag) {
  1364.       gl_rasterpos( vv );
  1365.    }
  1366. }
  1367.  
  1368.  
  1369. /*** 3 element vector ***/
  1370.  
  1371. void glRasterPos3dv( const GLdouble *v )
  1372. {
  1373.    GLfloat vv[4];
  1374.  
  1375.    vv[0] = (GLfloat) v[0];
  1376.    vv[1] = (GLfloat) v[1];
  1377.    vv[2] = (GLfloat) v[2];
  1378.    vv[3] = 1.0;
  1379.  
  1380.    if (CC.CompileFlag) {
  1381.       gl_save_rasterpos( vv );
  1382.    }
  1383.    if (CC.ExecuteFlag) {
  1384.       gl_rasterpos( vv );
  1385.    }
  1386. }
  1387.  
  1388.  
  1389. void glRasterPos3fv( const GLfloat *v )
  1390. {
  1391.    GLfloat vv[4];
  1392.  
  1393.    vv[0] = (GLfloat) v[0];
  1394.    vv[1] = (GLfloat) v[1];
  1395.    vv[2] = (GLfloat) v[2];
  1396.    vv[3] = 1.0;
  1397.  
  1398.    if (CC.CompileFlag) {
  1399.       gl_save_rasterpos( vv );
  1400.    }
  1401.    if (CC.ExecuteFlag) {
  1402.       gl_rasterpos( vv );
  1403.    }
  1404. }
  1405.  
  1406.  
  1407. void glRasterPos3iv( const GLint *v )
  1408. {
  1409.    GLfloat vv[4];
  1410.  
  1411.    vv[0] = (GLfloat) v[0];
  1412.    vv[1] = (GLfloat) v[1];
  1413.    vv[2] = (GLfloat) v[2];
  1414.    vv[3] = 1.0;
  1415.  
  1416.    if (CC.CompileFlag) {
  1417.       gl_save_rasterpos( vv );
  1418.    }
  1419.    if (CC.ExecuteFlag) {
  1420.       gl_rasterpos( vv );
  1421.    }
  1422. }
  1423.  
  1424.  
  1425. void glRasterPos3sv( const GLshort *v )
  1426. {
  1427.    GLfloat vv[4];
  1428.  
  1429.    vv[0] = (GLfloat) v[0];
  1430.    vv[1] = (GLfloat) v[1];
  1431.    vv[2] = (GLfloat) v[2];
  1432.    vv[3] = 1.0;
  1433.  
  1434.    if (CC.CompileFlag) {
  1435.       gl_save_rasterpos( vv );
  1436.    }
  1437.    if (CC.ExecuteFlag) {
  1438.       gl_rasterpos( vv );
  1439.    }
  1440. }
  1441.  
  1442.  
  1443. /*** 4 element vector ***/
  1444.  
  1445. void glRasterPos4dv( const GLdouble *v )
  1446. {
  1447.    GLfloat vv[4];
  1448.  
  1449.    vv[0] = (GLfloat) v[0];
  1450.    vv[1] = (GLfloat) v[1];
  1451.    vv[2] = (GLfloat) v[2];
  1452.    vv[3] = (GLfloat) v[3];
  1453.  
  1454.    if (CC.CompileFlag) {
  1455.       gl_save_rasterpos( vv );
  1456.    }
  1457.    if (CC.ExecuteFlag) {
  1458.       gl_rasterpos( vv );
  1459.    }
  1460. }
  1461.  
  1462.  
  1463. void glRasterPos4fv( const GLfloat *v )
  1464. {
  1465.    if (CC.CompileFlag) {
  1466.       gl_save_rasterpos( v );
  1467.    }
  1468.    if (CC.ExecuteFlag) {
  1469.       gl_rasterpos( v );
  1470.    }
  1471. }
  1472.  
  1473.  
  1474. void glRasterPos4iv( const GLint *v )
  1475. {
  1476.    GLfloat vv[4];
  1477.  
  1478.    vv[0] = (GLfloat) v[0];
  1479.    vv[1] = (GLfloat) v[1];
  1480.    vv[2] = (GLfloat) v[2];
  1481.    vv[3] = (GLfloat) v[3];
  1482.  
  1483.    if (CC.CompileFlag) {
  1484.       gl_save_rasterpos( vv );
  1485.    }
  1486.    if (CC.ExecuteFlag) {
  1487.       gl_rasterpos( vv );
  1488.    }
  1489. }
  1490.  
  1491.  
  1492. void glRasterPos4sv( const GLshort *v )
  1493. {
  1494.    GLfloat vv[4];
  1495.  
  1496.    vv[0] = (GLfloat) v[0];
  1497.    vv[1] = (GLfloat) v[1];
  1498.    vv[2] = (GLfloat) v[2];
  1499.    vv[3] = (GLfloat) v[3];
  1500.  
  1501.    if (CC.CompileFlag) {
  1502.       gl_save_rasterpos( vv );
  1503.    }
  1504.    if (CC.ExecuteFlag) {
  1505.       gl_rasterpos( vv );
  1506.    }
  1507. }
  1508.  
  1509.  
  1510.  
  1511. /*
  1512.  *
  1513.  * Texture coordinates
  1514.  *
  1515.  */
  1516.  
  1517.  
  1518. void glTexCoord1d( GLdouble s )
  1519. {
  1520.    glTexCoord4f( (GLfloat) s, 0.0, 0.0, 1.0 );
  1521. }
  1522.  
  1523. void glTexCoord1f( GLfloat s )
  1524. {
  1525.    glTexCoord4f( s, 0.0, 0.0, 1.0 );
  1526. }
  1527.  
  1528. void glTexCoord1i( GLint s )
  1529. {
  1530.    glTexCoord4f( (GLfloat) s, 0.0, 0.0, 1.0 );
  1531. }
  1532.  
  1533. void glTexCoord1s( GLshort s )
  1534. {
  1535.    glTexCoord4f( (GLfloat) s, 0.0, 0.0, 1.0 );
  1536. }
  1537.  
  1538. void glTexCoord2d( GLdouble s, GLdouble t )
  1539. {
  1540.    glTexCoord4f( (GLfloat) s, (GLfloat) t, 0.0, 1.0 );
  1541. }
  1542.  
  1543. void glTexCoord2f( GLfloat s, GLfloat t )
  1544. {
  1545.    glTexCoord4f( s, t, 0.0, 1.0 );
  1546. }
  1547.  
  1548. void glTexCoord2i( GLint s, GLint t )
  1549. {
  1550.    glTexCoord4f( (GLfloat) s, (GLfloat) t, 0.0, 1.0 );
  1551. }
  1552.  
  1553. void glTexCoord2s( GLshort s, GLshort t )
  1554. {
  1555.    glTexCoord4f( (GLfloat) s, (GLfloat) t, 0.0, 1.0 );
  1556. }
  1557.  
  1558. void glTexCoord3d( GLdouble s, GLdouble t, GLdouble r )
  1559. {
  1560.    glTexCoord4f( (GLfloat) s, (GLfloat) t, (GLfloat) r, 1.0 );
  1561. }
  1562.  
  1563. void glTexCoord3f( GLfloat s, GLfloat t, GLfloat r )
  1564. {
  1565.    glTexCoord4f( s, t, r, 1.0 );
  1566. }
  1567.  
  1568. void glTexCoord3i( GLint s, GLint t, GLint r )
  1569. {
  1570.    glTexCoord4f( (GLfloat) s, (GLfloat) t, (GLfloat) r, 1.0 );
  1571. }
  1572.  
  1573. void glTexCoord3s( GLshort s, GLshort t, GLshort r )
  1574. {
  1575.    glTexCoord4f( (GLfloat) s, (GLfloat) t, (GLfloat) r, 1.0 );
  1576. }
  1577.  
  1578. void glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q )
  1579. {
  1580.    glTexCoord4f( (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q );
  1581. }
  1582.  
  1583. void glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
  1584. {
  1585.    if (CC.CompileFlag) {
  1586.       GLfloat tc[4];
  1587.       tc[0] = s;
  1588.       tc[1] = t;
  1589.       tc[2] = r;
  1590.       tc[3] = q;
  1591.       gl_save_texcoord( tc );
  1592.    }
  1593.    if (CC.ExecuteFlag) {
  1594.       CC.Current.TexCoord[0] = s;
  1595.       CC.Current.TexCoord[1] = t;
  1596.       CC.Current.TexCoord[2] = r;
  1597.       CC.Current.TexCoord[3] = q;
  1598.    }
  1599. }
  1600.  
  1601. void glTexCoord4i( GLint s, GLint t, GLint r, GLint q )
  1602. {
  1603.    glTexCoord4f( (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q );
  1604. }
  1605.  
  1606. void glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q )
  1607. {
  1608.    glTexCoord4f( (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q );
  1609. }
  1610.  
  1611. void glTexCoord1dv( const GLdouble *v )
  1612. {
  1613.    glTexCoord4f( (GLfloat) *v, 0.0, 0.0, 1.0 );
  1614. }
  1615.  
  1616. void glTexCoord1fv( const GLfloat *v )
  1617. {
  1618.    glTexCoord4f( *v, 0.0, 0.0, 1.0 );
  1619. }
  1620.  
  1621. void glTexCoord1iv( const GLint *v )
  1622. {
  1623.    glTexCoord4f( (GLfloat) *v, 0.0, 0.0, 1.0 );
  1624. }
  1625.  
  1626. void glTexCoord1sv( const GLshort *v )
  1627. {
  1628.    glTexCoord4f( (GLfloat) *v, 0.0, 0.0, 1.0 );
  1629. }
  1630.  
  1631. void glTexCoord2dv( const GLdouble *v )
  1632. {
  1633.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1], 0.0, 1.0 );
  1634. }
  1635.  
  1636. void glTexCoord2fv( const GLfloat *v )
  1637. {
  1638.    glTexCoord4f( v[0], v[1], 0.0, 1.0 );
  1639. }
  1640.  
  1641. void glTexCoord2iv( const GLint *v )
  1642. {
  1643.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1], 0.0, 1.0 );
  1644. }
  1645.  
  1646. void glTexCoord2sv( const GLshort *v )
  1647. {
  1648.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1], 0.0, 1.0 );
  1649. }
  1650.  
  1651. void glTexCoord3dv( const GLdouble *v )
  1652. {
  1653.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0 );
  1654. }
  1655.  
  1656. void glTexCoord3fv( const GLfloat *v )
  1657. {
  1658.    glTexCoord4f( v[0], v[1], v[2], 1.0 );
  1659. }
  1660.  
  1661. void glTexCoord3iv( const GLint *v )
  1662. {
  1663.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0 );
  1664. }
  1665.  
  1666. void glTexCoord3sv( const GLshort *v )
  1667. {
  1668.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0 );
  1669. }
  1670.  
  1671. void glTexCoord4dv( const GLdouble *v )
  1672. {
  1673.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1],
  1674.          (GLfloat) v[2], (GLfloat) v[3] );
  1675. }
  1676.  
  1677. void glTexCoord4fv( const GLfloat *v )
  1678. {
  1679.    glTexCoord4f( v[0], v[1], v[2], v[3] );
  1680. }
  1681.  
  1682. void glTexCoord4iv( const GLint *v )
  1683. {
  1684.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1],
  1685.          (GLfloat) v[2], (GLfloat) v[3] );
  1686. }
  1687.  
  1688. void glTexCoord4sv( const GLshort *v )
  1689. {
  1690.    glTexCoord4f( (GLfloat) v[0], (GLfloat) v[1],
  1691.          (GLfloat) v[2], (GLfloat) v[3] );
  1692. }
  1693.  
  1694.  
  1695.  
  1696. /*
  1697.  *
  1698.  * Polygon Edge Flags
  1699.  *
  1700.  */
  1701.  
  1702.  
  1703. void glEdgeFlag( GLboolean flag )
  1704. {
  1705.    if (CC.ExecuteFlag) {
  1706.       CC.Current.EdgeFlag = flag;
  1707.    }
  1708.    if (CC.CompileFlag) {
  1709.       gl_save_set_boolean( &CC.Current.EdgeFlag, flag );
  1710.    }
  1711. }
  1712.  
  1713.  
  1714.  
  1715. void glEdgeFlagv( const GLboolean *flag )
  1716. {
  1717.    if (CC.ExecuteFlag) {
  1718.       CC.Current.EdgeFlag = *flag;
  1719.    }
  1720.    if (CC.CompileFlag) {
  1721.       gl_save_set_boolean( &CC.Current.EdgeFlag, *flag );
  1722.    }
  1723. }
  1724.